<? include('includes/dbConnection.php');?>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1">
<title></title><head>
<link rel="stylesheet" href="library/styles.css">
<link rel="stylesheet" href="css/lightbox.css" type="text/css" media="screen" />
<script type="text/javascript" src="scripts/prototype.js"></script>
<script type="text/javascript" src="scripts/scriptaculous.js?load=effects,builder"></script>
<script type="text/javascript" src="scripts/lightbox.js"></script>
<script type="text/javascript" src="./scripts/js.js"></script>
<script type="text/javascript" src="./scripts/data.js"></script>
<script type="text/javascript" src="./scripts/functions.js"></script>
<script type="text/javascript">var totalSlideNum=0;</script>
 
</head>
<body background="">
<div id="wrapper">
<div id="caption"
style="background-color:#004586;width:100%;margin:auto;overflow:
hidden;">
<center>
<span class=caption id="presTitle"></span></center>
</div>
<!-- fixed menu-->
<div id="menu" style="background-color:#efefef;background-image:url(./images/tuhh_logo_bg_v1.png);width:25%;margin:auto;border:1px solid #0000ff;">
<a href='#' onclick="createSlideThumbnail();">
[New Slide]
</a>
<br />
<a href='#' onclick="deleteSlideThumbnail();">
[Remove Slide]
</a>
<br />
<a href='#' onclick="savePresentation();">
[Save Presentation]
</a>
</div><!-- fixed menu end -->
<!-- fixed status-->
<div id="statBar" style="background-color:#efefef;width:25%;margin:auto;border:1px solid #0000ff;">

</div><!-- fixed status -->

<?php
$presId=$_GET['presId'];
if($presId=="") $presId=1; //if none selected geerate new presID

//echo "PresId".$presId;
echo "<script>var presId=$presId;</script>";
$sqlQuery=mysql_query("SELECT * FROM presentations where presId=$presId") or die(mysql_error());//sort by slideId
$rs=mysql_fetch_assoc($sqlQuery);
$presTitle=$rs['presTitle'];
$slideNum=$rs['slideNum'];
echo $presTitle . " ".$slideNum . " slides";
echo "<script>document.getElementById('presTitle').innerHTML='$presTitle';</script>";
//echo "<script>id=$slideNum;</script>";
?>


 

<div id="slides_overview" style="overlfow:auto;" class="slides_overview" ">
<?

for($i=1;$i<=$slideNum;$i++){ 
//echo "<br>";
$sql=mysql_query("SELECT * FROM slides WHERE slideId='$i' and presId='$presId'") or die(mysql_error());
$rs=mysql_fetch_assoc($sql);
$presId=$rs['presId'];
$slideCaptions[$i]=$rs['caption'];
$slideContent[$i]=$rs['content'];
echo "<script>slideContent[$i]='".$slideContent[$i]."';</script>";
echo "<script>createSlideThumbnail();</script>";
//echo "<script>alert(slideContent[$i]);</script>";

}

?>
</div>

<div id="slide_container" class="slide_container">
<div id="slide_overview" class="slide_overview" onclick="createInput(this,'editField','text');"></div>
</div>

<div style="clear:both;"></div>

<a href="generate.php" target=_blank>Generate Slides</a>
</div><!-- /wrapper-->
</body>
 </html>
